import HttpUtil from '../utils/httpUtil.js'

export default {
    getCourses(pageNum, callback) {
        HttpUtil.get({
            uri: '/api/getCourses/' + pageNum + '/5', success: (data) => {
                callback(data);
            }
        });
    },
    getCourse(id, callback) {
        HttpUtil.get({
            uri: '/api/getCourse/' + id, success: (data) => {
                callback(data);
            }
        });
    },
    getCourseByUserId(id,callback){
        HttpUtil.get({
            uri:'/api/getCourseByUserId/'+id,success: (data) => {
                callback(data);
            }
        });
    },
    getCatalogues(id, callback) {
        HttpUtil.get({
            uri: '/api/getCatalogues/' + id, success: (data) => {
                callback(data);
            }
        });
    }
}

